<template>
  <div class="fhchat">
    <FhEditor v-model:value="htmlString" :height="300"></FhEditor>
    <div class="send">
      <titleForm @sendClick="sendClickhandler"></titleForm>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, watchEffect } from 'vue'
import FhEditor from '@/base-ui/editor'
import titleForm from './cpns/titleForm.vue'
import FhRequest from '@/service/index'
import { IDatatype } from '@/service/types'
const htmlString = ref<string>('Fhup')
watchEffect(() => {
  console.log(htmlString.value)
})
const sendClickhandler = (title: string) => {
  const result = FhRequest.post<IDatatype>({
    url: '/story',
    data: {
      title,
      content: htmlString.value
    },
    showLoading: false
  })
  result.then((res) => {
    console.log(res.data)
  })
}
</script>

<style scoped lang="less">
.send {
  margin-top: 50px;
  width: 200px;
  z-index: 500;
}
</style>
